function changePassword() {

    $.ajax({
            url: 'user/resetPassword',
            type: "POST",
            data: {
                password:$("#newPas").val(),
                repPassword:$("#newPas").val(),
                phoneCode:$("#verCode").val()
            }
            ,
            success: function (data) {
                
                console.log(data);
                switch (data['status']) {
                    case 0:
                        window.location.href = "login.html";
                        break;
                    default:
                        alert(data['msg']);
                        break;
                }
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );

}

function checkpassword() {

    var firstpassword = $("#newPas").val();
    var secondpassword = $("#newPasAg").val();

    if (!(firstpassword === secondpassword)){
        alert("两次密码不一致");
        $("#confirm").attr("disabled","disabled");
    }else {
        $("#confirm").removeAttr("disabled");
    }
}

function sendCode() {

    $.ajax({
            url: 'user/sendSignUpPhoneCode',
            type: "POST",
            data: {
            	phoneNum:$("#myemail").val(),       
            	type:1
            }
            ,
            success: function (data) {
            	console.log(data);
                switch (data['status']){
                    case 0:
                    	alert("发送手机验证码成功");
                        break;
                    default:
                    	alert("发送手机验证码失败");
                        break;
                }
            }
            ,
            error: function (err) {
                console.log(err);
            }
        }
    );

}

